package cn.imnaer.service.rpc.userinfo;



import java.util.List;

import cn.imnaer.service.persistence.model.FriendRelation;
import cn.imnaer.service.persistence.model.FriendRequest;
import cn.imnaer.service.persistence.model.User;
import cn.imnaer.service.rest.resquest.model.FriendRelationParams;
import cn.imnaer.service.rest.view.model.FriendRequestResponse;
import cn.imnaer.service.rest.view.model.SimpleUser;

/**
 * Created by Administrator on 2015/5/22.
 */
public interface FriendRelationComponentRpcApi {
    List<FriendRelation> findByUserId(String userId);
    List<FriendRelation> findByUserId(User user);

    public List<FriendRelation> findRealFriendRelationsByUserId(User user);

    public List<FriendRelation> findRealFriendRelationsByUserId(String userId);

    public List<String> findRealFriendUserIdsByUserId(User user);

    public List<String> findRealFriendUserIdsByUserId(String userId);

    /**
     * 保存好友关系, 有可能是更新
     * @param userId
     * @param targetUserId
     */
    public SimpleUser buildFriendRelations(String userId, String targetUserId);

    /**
     *
     * @param selfUserId
     * @param targetUserId
     * @return
     */
    public boolean deleteFriendRelation(String selfUserId, String targetUserId);

    public boolean updateFriendRelation(String selfUserId, String targetUserId, String note, boolean isStart);

    public boolean updateFriendRelation(FriendRelationParams request);

    /**
     * 发送小纸条 (建立好友请求)
     * @param sendUserId
     * @param acceptUserId
     * @param content
     */
    public FriendRequest sendPaper(String sendUserId, String acceptUserId, String content);

    /**
     * 回复小纸条
     * @param requestId
     * @param sendUserId
     * @param content
     */
    public FriendRequest replyPaper(String requestId, String sendUserId, String content);

    public Long countUnReadFriendRequest(String userId);

    public List<FriendRequestResponse> findUnReadFriendRequest(String userId);

    public List<FriendRequestResponse> findAllFriendRequest(String userId);

    public void deleteFriendRequest(String requestId);

    /**
     * 获得新好友通知
     * @param userId
     * @return
     */
    public Long countNewFriendNotice(String userId);



}
